#pragma once
#include "RBTree_t.h"

namespace dwc
{
	template<class K, class V>
	class map
	{
		struct GetKeyOfT
		{
			const K& operator()(const pair<K,V>& val)
			{
				return val.first;
			}
		};
	public:
		typedef typename RBTree<K, pair<K, V>, GetKeyOfT>::iterator iterator;

		iterator begin()
		{
			return _t.begin();
		}
		
		iterator end()
		{
			return _t.end();
		}

		bool Insert(const pair<K,V>& val)
		{
			return _t.Insert(val);
		}
	private:
		RBTree<K, pair<K,V>, GetKeyOfT> _t;
	};
}